# Group Custom System Roles

This Group's APIs are used to list, create, delete or update Custom System Roles.


## Custom System Roles Collections [/v1/custom-system-roles]


### List All Custom System Roles [GET]
Get a list of all Custom System Roles.


+ Request

    + Headers

            Accept: application/vnd.api+json
            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
            "jsonapi": {
                "version": "1.0"
            },
            "meta": {
                "count": 2
            },
            "links": {
                "self": "/v1/custom-system-roles"
            },
            "data": [
                {
                    "relationships": {
                        "panel-permissions": {
                            "links": {
                                "self": "/v1/custom-system-roles/1/relationships/panel-permissions",
                                "related": "/v1/custom-system-roles/1/panel-permissions"
                            }
                        }
                    },
                    "type": "custom-system-role",
                    "links": {
                        "self": "/v1/custom-system-roles/1"
                    },
                    "attributes": {
                        "name": "Sales Admin"
                    },
                    "id": "1"
                },
                {
                    "relationships": {
                        "panel-permissions": {
                            "links": {
                                "self": "/v1/custom-system-roles/2/relationships/panel-permissions",
                                "related": "/v1/custom-system-roles/2/panel-permissions"
                            }
                        }
                    },
                    "type": "custom-system-role",
                    "links": {
                        "self": "/v1/custom-system-roles/2"
                    },
                    "attributes": {
                        "name": "Marketer"
                    },
                    "id": "2"
                }
            ]
        }

### Create Custom System Role [POST]
Create a new custom system role using a name.

+ Request

    + Headers

            Content-Type: application/vnd.api+json
            Authorization: JWT <Auth Key>

    + Body

            {
                "data": {
                    "attributes": {
                        "name": "Accountant"
                    },
                    "type": "custom-system-role"
                }
            }

+ Response 201 (application/vnd.api+json)

        {
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/custom-system-roles/3"
            },
            "data": {
                "relationships": {
                    "panel-permissions": {
                        "links": {
                            "self": "/v1/custom-system-roles/3/relationships/panel-permissions",
                            "related": "/v1/custom-system-roles/3/panel-permissions"
                        }
                    }
                },
                "type": "custom-system-role",
                "links": {
                    "self": "/v1/custom-system-roles/3"
                },
                "attributes": {
                    "name": "Accountant"
                },
                "id": "3"
            }
        }

## Custom System Roles Details [/v1/custom-system-roles/{custom_system_role_id}]
+ Parameters
    + custom_system_role_id: 1 (integer) - ID of the custom system role in the form of an integer.

### Get Details [GET]
Get a single custom system role.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/custom-system-roles/1"
            },
            "data": {
                "relationships": {
                    "panel-permissions": {
                        "links": {
                            "self": "/v1/custom-system-roles/1/relationships/panel-permissions",
                            "related": "/v1/custom-system-roles/1/panel-permissions"
                        }
                    }
                },
                "type": "custom-system-role",
                "links": {
                    "self": "/v1/custom-system-roles/1"
                },
                "attributes": {
                    "name": "Marketer"
                },
                "id": "1"
            }
        }

### Update Custom System Role [PATCH]
+ `id` (integer) - ID of the record to update **(required)**

Update a single custom system role.


+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
                "data": {
                    "attributes": {
                        "name": "Manager"
                    },
                    "type": "custom-system-role",
                    "id": "1"
                }
            }
+ Response 200 (application/vnd.api+json)

        {
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/custom-system-roles/1"
            },
            "data": {
                "relationships": {
                    "panel-permissions": {
                        "links": {
                            "self": "/v1/custom-system-roles/1/relationships/panel-permissions",
                            "related": "/v1/custom-system-roles/1/panel-permissions"
                        }
                    }
                },
                "type": "custom-system-role",
                "links": {
                    "self": "/v1/custom-system-roles/1"
                },
                "attributes": {
                    "name": "Manager"
                },
                "id": "1"
            }
        }

### Delete Custom Systen Role [DELETE]
Delete a single custom system.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "message": "Object successfully deleted"
          },
          "jsonapi": {
            "version": "1.0"
          }
        }


## Get Custom System Role Details for a Panel Permission [/v1/panel-permissions/{panel_permission_id}/custom-system-roles]
+ Parameters
    + panel_permission_id: 1 (integer) - ID of the panel permission in the form of an integer.


### Get Custom System Role Details for a Panel Permission [GET]
Get the details of the custom system roles for a panel permission.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>


+ Response 200 (application/vnd.api+json)


        {
            "jsonapi": {
                "version": "1.0"
            },
            "meta": {
                "count": 2
            },
            "links": {
                "self": "/v1/custom-system-roles"
            },
            "data": [
                {
                    "relationships": {
                        "panel-permissions": {
                            "links": {
                                "self": "/v1/custom-system-roles/1/relationships/panel-permissions",
                                "related": "/v1/custom-system-roles/1/panel-permissions"
                            }
                        }
                    },
                    "type": "custom-system-role",
                    "links": {
                        "self": "/v1/custom-system-roles/1"
                    },
                    "attributes": {
                        "name": "Sales Admin"
                    },
                    "id": "1"
                },
                {
                    "relationships": {
                        "panel-permissions": {
                            "links": {
                                "self": "/v1/custom-system-roles/3/relationships/panel-permissions",
                                "related": "/v1/custom-system-roles/3/panel-permissions"
                            }
                        }
                    },
                    "type": "custom-system-role",
                    "links": {
                        "self": "/v1/custom-system-roles/3"
                    },
                    "attributes": {
                        "name": "Accountant"
                    },
                    "id": "3"
                }
            ]
        }
